package com.health.work.activity;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.Gravity;
import android.view.KeyEvent;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.TextView;

import com.health.work.R;

/**'
 * 商家自我介绍页
 * @author star
 *
 */
public class SellerIntroduceActivity extends Activity{

	private Button back;
	private String introduce;
	private TextView intro;
	private TextView publish;
	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.doctor_introduce_layout);
		initPages();
	}

	private void initPages() {

		back = (Button) findViewById(R.id.btnBack);
		intro = (TextView) findViewById(R.id.introduce);
		publish=(Button)findViewById(R.id.btn);
		publish.setVisibility(View.VISIBLE);
		back.setOnClickListener(onClickListener);
		publish.setOnClickListener(onClickListener);
		Bundle bundle = getIntent().getExtras();
		if (bundle != null) {
			introduce = (String) bundle.getString("introduce");
			if (introduce != null && !introduce.equals("")) {
				intro.setText(introduce);
			} else {
				intro.setGravity(Gravity.CENTER);
				intro.setText("暂无介绍");
			}
		}
	}

	OnClickListener onClickListener=new OnClickListener() {

		@Override
		public void onClick(View v) {
			// TODO Auto-generated method stub
			switch (v.getId()) {
			case R.id.btnBack:
				finish();
				break;
			case R.id.btn:
				Intent intent;
				intent=new Intent(SellerIntroduceActivity.this, PublishActivity.class);
				startActivity(intent);
			default:
				break;
			}
		}
		
	};
	@Override
	protected void onDestroy() {
		super.onDestroy();
	}

	@Override
	protected void onPause() {
		super.onPause();
	}

	@Override
	protected void onRestart() {
		super.onRestart();
	}

	@Override
	protected void onResume() {
		super.onResume();
	}

	@Override
	protected void onStart() {
		super.onStart();
	}

	@Override
	protected void onStop() {
		super.onStop();
	}

	@Override
	public boolean onKeyDown(int keyCode, KeyEvent event) {
		return super.onKeyDown(keyCode, event);
	}
}
